package com.lancoo.ccas52.mapper;
import java.util.List;
import java.util.Map;

import com.lancoo.ccas52.pojo.common.GroupObject;
import org.apache.ibatis.annotations.Param;

import com.lancoo.ccas52.entity.CourseWeek;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas52.config.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;

/**
 * <p>
 * 设置课程对应上课周数 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2023-02-22
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface CourseWeekMapper extends BaseMapper<CourseWeek> {

    List<CourseWeek> selectAllByTeachingPlanId(@Param("teachingPlanIds") List<Long> teachingPlanIds);

    /**
     * 根据课程id查询课程对应上课周数
     * @param courseIds
     * @return
     */
    List<CourseWeek> selectAllByCourseId(@Param("courseIds") List<Long> courseIds);

    int insertSelective(CourseWeek courseWeek);

    /**
     * 统计已设置课程参数 单双周数量
     * @param taskId
     * @return
     */
    List<GroupObject<Number, Number>> oddEvenWeekStatistics(@Param("taskId") Integer taskId);

}
